<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <!--<meta charset="UTF-8">-->
    <!--<title></title>-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/style.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/main.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/maina1.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/login.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/animate.css">-->
    <!--<link rel="stylesheet" type="text/css" href="/taobao_3dchat/Public/Web/css/my.css">-->


    <!--Bootstrap 引入--------->
    <!--<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>-->
    <!--<script type="text/javascript" src="/taobao_3dchat/Public/Web/js/jquery.min.js"></script>-->
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <!--<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->


    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <!--<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>-->


    <!--Bootstrap 引入 end -------------------------->
    <!-- 配置文件 -->
    <!--<script type="text/javascript" src="/taobao_3dchat/Public/Web/Ueditor/ueditor.config.js"></script>-->
    <!-- 编辑器源码文件 -->
    <!--<script type="text/javascript" src="/taobao_3dchat/Public/Web/Ueditor/ueditor.all.js"></script>-->
    <!--<script type="text/javascript" charset="utf-8" src="/taobao_3dchat/Public/Web/Ueditor/lang/zh-cn/zh-cn.js"></script>-->


    <script type="text/javascript">
        function getitems(id, title, ele) {
            $(".chooselistitem").removeClass("chooselistitem").addClass("list_item");
            $(ele).removeClass("list_item").addClass("chooselistitem");
            $("#right_main_page").load("/taobao_3dchat/index.php/index/getitems/id/" + id, function () {
                $("#title_artcle").text(title);
            });
        }
    </script>

    <script type="text/javascript">
        function pushnewartcle(type) {
            var title = $("#newartcletitle").val();
            if (title.length>0)
            {
                var content = UE.getEditor('container').getContent();
                if (content.length>0)
                {


                $.post("/taobao_3dchat/index.php/Index/addItem", {'type': type, 'title': title, 'myContent': content}, function (data) {
                    switch (data.status) {
                        case 1:
                            alert("发帖成功");
                            $("#left_list").load("/taobao_3dchat/index.php/index/getitemlist/type/" + type, function () {
//                $("#sort_name").text("["+title+"]");
                            });
                            break
                        case 2:
                            break
                    }
                }, "json");
                }
                else
                {
                    alert("内容不能为空!");
                }
            }
            else
            {
                alert("标题不能为空!");
            }

        }

    </script>
    <script type="text/javascript">
        function pushnewtie() {
//            alert("打开回复");
            var ue = UE.getEditor('container', {
                serverUrl: "<?php echo U(MODULE_NAME.'/Index/save_info');?>",
                toolbars: [['fontfamily', 'simpleupload', 'fontsize', 'forecolor', 'link']]
            });
            ue.addListener("ready", function () {
//                alert("打开模态框");
            });
            if (ue.isReady) {
//                  alert("打开模态框2");
            }
            $("#modal-newart").modal('show');
        }
    </script>


</head>
<body>
<div style="width: auto;height: 900px;background-color: #fff;">
    <!-- Modal -->
    <div class="modal fade" id="modal-newart" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"
                            style="margin-bottom: 6px">&times;</button>
                    <input id="newartcletitle" type="text" class="form-control input-lg" placeholder="標題">
                    <input name="type" value="<?php echo ($type); ?>" hidden="hidden" type="text">
                </div>
                <div class="modal-body">
                    <div style="height: 300px;width: 100%;bottom: 10px;display: block" id="bottom_layout">
                        <script id="container" name="myContent" type="text/plain" class="edui-default"
                                style="height: 200px">
                        </script>
                    </div>
                </div>
                <div class="modal-footer">
                    <input class="btn btn-primary btn-lg btn-block" type="submit" name="submit" value="發佈"
                           data-dismiss="modal" aria-label="Close" onclick="pushnewartcle('<?php echo ($type); ?>')">
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        UE.delEditor('container');
    </script>
    <!--这里是弹出框 end--------------- -->


    <?php if(is_array($itemlist)): $i = 0; $__LIST__ = $itemlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$itemlist): $mod = ($i % 2 );++$i;?><div class="list_item" onclick="getitems('<?php echo ($itemlist["id"]); ?>','<?php echo ($itemlist["title"]); ?>',this)">
            <div class="listitem_font">
                <div class="right_list_name chat-person" style="display: inline" data-id="<?php echo ($itemlist["author"]); ?>">
                    <?php echo ($itemlist["nickname"]); ?>
                </div>
                <div class="listitem_font" style="margin-left: 8px;font-size: 10px; display: inline ;">
                    <?php echo (date("Y-m-d H:i:s",$itemlist["time"])); ?>
                </div>
                <div class="listitem_font" style="margin-left: 8px; font-size: 10px; display: inline">
                    回复:<?php echo ($itemlist["creply"]); ?>
                </div>
                <div class="listitem_font" style="margin-left: 8px; font-size: 10px; display: inline">
                    <img class="listitem_font" src="/taobao_3dchat/Public/Web/img/zan.png"
                         style="height: 12px;width: 12px;display: inline">
                    <span class="listitem_font" id="zan<?php echo ($itemlist["id"]); ?>"><?php echo ($itemlist["cgood"]); ?></span>
                </div>
                <div class="listitem_font" style="margin-left: 8px; font-size: 10px; display: inline">
                    <img class="listitem_font" src="/taobao_3dchat/Public/Web/img/chaping.png"
                         style="height: 12px;width: 12px;display: inline">
                    <span class="listitem_font" id="bad<?php echo ($itemlist["id"]); ?>"><?php echo ($itemlist["cbad"]); ?></span>
                </div>
            </div>
            <div class="listitem_font">
                <div class="right_list_title" style="display: inline" id="sort_name">
                </div>
                <div class="right_list_title" style="display: inline ;margin-left: 20px">
                    <?php echo ($itemlist["title"]); ?>
                </div>
            </div>
        </div><?php endforeach; endif; else: echo "" ;endif; ?>


</div>
</body>
<!--<script type="text/javascript" src="/taobao_3dchat/Public/Web/js//main.js"></script>-->
<!--<script type="text/javascript" src="/taobao_3dchat/Public/Web/js//new.js"></script>-->

</html>